﻿Public Class AdjustmentSessions
    Inherits Telerik.Web.UI.RadAjaxPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then

        End If
    End Sub

    Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
        Try
            Dim dict As New Dictionary(Of String, Object)
            dict.Add("SessionDescription", txtDescription.Text)
            dict.Add("CreatedDate", DateTime.Now)

            BL.InventoryAdjustments.InsertInventoryAdjustments(dict)
            rgSessions.DataBind()

            txtDescription.Text = ""

        Catch ex As Exception
            WebMsgBox.ShowError(ex.Message)
        End Try
    End Sub

    Private Sub rgSessions_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles rgSessions.ItemCommand
        If e.CommandName = "ShowDetails" Then
            Response.Redirect("~/admin/CycleCount.aspx?sessionid=" & e.CommandArgument)
        End If
    End Sub
End Class